﻿package phpas3{

	public function strcasecmp (f_string1:String, f_string2:String):int {
	    // Binary safe case-insensitive string comparison
	    //
	    // version: 1109.2015
	    // discuss at: http://phpjs.org/functions/strcasecmp
	    // +     original by: Martijn Wieringa
	    // +     bugfixed by: Onno Marsman
	    // *         example 1: strcasecmp('Hello', 'hello');
	    // *         returns 1: 0
	    var string1 = (f_string1 + '').toLowerCase();
	    var string2 = (f_string2 + '').toLowerCase();

	    if (string1 > string2) {
	        return 1;
	    } else if (string1 == string2) {
	        return 0;
	    }

	    return -1;
	}

}